package com.janj.controller;

import com.janj.bean.Grade;
import com.janj.bean.Student;
import com.janj.service.OneToMoreService;
import com.janj.service.OneToMoreServiceImpl;
import org.junit.Test;

import java.util.List;

public class OneToMoreDemo {
    @Test
    public void testSelectOneToMore(){
        OneToMoreService service = new OneToMoreServiceImpl();
        List<Grade> array = service.selectOneToMore();
        System.out.println("------------");
        for (Grade g : array) {
            List<Student> list = g.getList();
            for (Student stu : list) {
                System.out.println(g.getGname()+","+stu.getSname()+","+stu.getAge());
            }
        }
    }
}
